# priority -50

snippet @ "@import"
@import "${1:path}"
endsnippet

snippet , "rem"
${1:1}rem$0
endsnippet

snippet . "px"
${1:1}px$0
endsnippet

snippet / "%"
${1:100}%$0
endsnippet

##################### Media query #####################################

snippet @m() "@media query 介于960-1199px之间"
@media screen and (min-width: ${1:960}px) and (max-width: ${2:1199}px)
endsnippet

snippet @m( "@media query 大于1120px"
@media screen and (min-width: ${1:1120}px)
endsnippet

snippet @m) "@media query 小于479px"
@media only screen and (max-width: ${1:479}px)
endsnippet

#######################################################################

snippet blur "filter blur"
filter blur(${1:10}px)
endsnippet

#######################################################################

snippet pos "position" pos
position $2`!p snip.rv=comp(t[2], ['relative', 'absolute', 'fixed', 'static'])`
endsnippet

#######################################################################

snippet ! "!important CSS (!)"
!important
endsnippet

snippet tsh "text-shadow: color-hex x y blur (text)"
text-shadow: ${1:${2:color} ${3:offset-x} ${4:offset-y} ${5:blur}}$0
endsnippet

snippet bxsh "box-shadow: color-hex x y blur (text)"
box-shadow: ${1:${2:offset-x} ${3:offset-y} ${4:blur} ${5:spread} ${6:color}}$0
endsnippet


snippet clear "clear: value (clear)"
clear: ${1:left/right/both/none}$0
endsnippet
#######################################################################
#                                自定义函数                                #
#######################################################################
#*
#*t //输入字符
#*t[n] //输入到第n个字符
#*
global !p
def comp(t, opts):
	if t:
		opts = [ m[len(t):] for m in opts if m.startswith(t)]
	if len(opts) == 1:
		return opts[0]
	return "(" + '|'.join(opts) + ')'
endglobal
#######################################################################

